@{
    Layout = null;
}
@using MvcDemo.Models
@model IEnumerable<Product>

<link rel="stylesheet" href="~/css/base.css" />
<div>
    <div style="width: 350px;">
        <tr>
            <td><input type="text" name="keyword" placeholder="请输入关键字" /></td>
            <td><button onclick="btnquery()">查询</button></td>
            <td><button onclick="btnadd()">新增</button></td>
        </tr>
    </div>
    <table>
        <thead>
            <tr>
                <td>Id</td>
                <td>商品名称</td>
                <td>供应商名称</td>
                <td>价格</td>
                <td>库存数量</td>
                <td>备注</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody name=tbdata>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@item.Id</td>
                    <td>@item.ProductName</td>
                    <td>@item.Supplier</td>
                    <td>@item.Price</td>
                    <td>@item.Supplier</td>
                    <td>@item.Remarks</td>
                    <td>
                        <button onclick="btnedit(@item.Id)">修改</button>
                        <button onclick="btndel(@item.Id)">刪除</button>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>

<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/js/base.js"></script>